package org.ly817.my.spring.core;

import org.ly817.victorinox.myspring.ioc.bean.BeanDefinition;
import org.ly817.victorinox.myspring.ioc.bean.PropertyValue;
import org.ly817.victorinox.myspring.ioc.bean.PropertyValues;
import org.ly817.victorinox.myspring.ioc.factory.AutowireCapableBeanFactory;
import org.ly817.victorinox.myspring.ioc.factory.BeanFactory;

/**
 * Created by LuoYu on 2018/4/9.
 */
public class Main {
    public static void main(String[] args) throws Exception {
        BeanFactory factory = new AutowireCapableBeanFactory();
        BeanDefinition bean = new BeanDefinition();
        bean.setBeanClassName("org.ly817.victorinox.basic.myspring.TestService");


        PropertyValues propertyValues = new PropertyValues();
        propertyValues.addPropertyValue(new PropertyValue("name", "luoyu"));
        bean.setBeanPropertyValues(propertyValues);
//        factory.registerBeanDefinition("testService",bean);

        TestService testService = (TestService) factory.getBean("testService");
        testService.hello();

    }
}
